﻿<%@ Page Language="C#" MasterPageFile="~/Themes/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PagedList<Goods>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    主页
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="sideNav">
        <h3>所有产品</h3>
        <div class="cateNav">
            <%List<Category> categoryList = TempData["CategoryList"] as List<Category>;%>
            <%if (null != categoryList){
                foreach (Category cate in categoryList){%>
                    <%=Html.Link(cate.Name, true, true, new RouteValueDictionary { { "cid", cate.ID } }, new RouteValueDictionary { { "rel", cate.ID } })%>
            <%
                }
            }
            %>
        </div>
        <%
            List<CategoryPropertyValue> categoryPropertyValues = TempData["PropertiesList"] as List<CategoryPropertyValue>;
            if(null != categoryPropertyValues){
            foreach(CategoryPropertyValue cpvale in categoryPropertyValues){ %>
        <h3>
            <%=cpvale.PropName %></h3>
        <div class="cateNav">
            <%foreach(PropertyValue pvale in cpvale.PropValues){ %>
            <%= Html.Link(pvale.ValueName, false, true, new RouteValueDictionary { { "pid", string.Format("{0}:{1}",cpvale.PropId,pvale.ValueId) } }, new RouteValueDictionary { { "rel", string.Format("{0}:{1}",cpvale.PropId,pvale.ValueId) } })%>
            <%} %>
        </div>
        <%}} %>
    </div>

    <div id="ProductContent">
        <div id="subnav">所有产品</div>
        <div id="catetorysel">
            <span>已选择的类型：</span>
            <ul></ul>
        </div>
        <div id="plclass">
            <select id="Sort">
                <option value="0">选择排序规则</option>
                <option value="LastUpdateTime_ASC">最近更新</option>
                <option value="BrowseCount_ASC">人气产品</option>
                <option value="Price_DESC">价格由高到低</option>
                <option value="Price_ASC">价格由低到高</option>
                <option value="PubTime_ASC">最新发布</option>
            </select>
        </div>
        <div style="height: 1px; line-height: 1px;"></div>
        <div id="ProductList">
            <%foreach (var item in Model)
              {%>
            <dl>
                <dt><a href="<%=Url.Action("Index", "Goods", new { id = item.ID })%>"><img src="<%=item.GetMajorImages().FirstOrDefault().ImgURL%>" alt="" /></a></dt>
                <dd class="PName">
                    <%=Html.ActionLink(item.Title, "Index", "Goods", new { id = item.ID }, null)%>
                    <%if (item.IsRecommend){%><img src="/Style/Images/hot.jpg" alt="" /><%} %>
                </dd>
                <dd class="PPrice">
                    <span style="height: 20px; margin: 0px; font-size: 12px;">￥</span>
                    <div style="width:75px; overflow:hidden; float:left"><%=item.Price%></div>
                    <%=Html.ActionLink("下载图片", "ImageData", "Download", new { ID = item.ID }, new { target = "_blank" })%>
                </dd>
                <dd class="PIntro"><%=item.Tag%></dd>
            </dl>
            <%} %>
        </div>
        <div class="pager" style="padding:10px 10px 0 0;">
            <%= Html.Pager("index","home",Model.PageIndex, Model.PageSize, Model.TotalCount)%>
        </div>
    </div>
</asp:Content>

<asp:Content ID="js" ContentPlaceHolderID="JsContent" runat="server">
    <script language="javascript" type="text/javascript" src="/Scripts/JQuery.Query.js"></script>
    <script language="javascript" type="text/javascript" src="/js/lukou.ui.js"></script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="CssContent" runat="server">
    <link href="<%=Url.Content("~/Style/Index.css")%>" rel="stylesheet" type="text/css" />
</asp:Content>